package com.zmn.oms.business.impl.work.orderpay;

import com.zmn.oms.common.enums.RefundInitiateTypeEnum;
import com.zmn.oms.model.bo.refund.RefundInitiateBO;
import org.apache.dubbo.config.annotation.Reference;
import com.alibaba.fastjson.JSON;
import com.zmn.account.common.constant.AccountConsts;
import com.zmn.account.common.constant.IdentityConsts;
import com.zmn.account.common.dto.account.AccountInfoDIO;
import com.zmn.account.common.dto.account.AccountInfoDRO;
import com.zmn.account.dubbo.interfaces.account.AccountListRemoteService;
import com.zmn.common.dto2.ResponseDTO;
import com.zmn.common.utils.date.DateUtil;
import com.zmn.common.utils.number.NumberUtil;
import com.zmn.oms.common.constant.MessageQueueTagConsts;
import com.zmn.oms.common.constant.OrderConsts;
import com.zmn.oms.common.dto.OmsOperator;
import com.zmn.oms.common.dto.OmsPayRequestDTO;
import com.zmn.oms.common.dto.OmsRefundRequestDTO;
import com.zmn.oms.common.exception.OmsBaseException;
import com.zmn.oms.model.dto.order.OrderDTO;
import com.zmn.oms.model.dto.work.modify.must.ZsOrderPayDTO;
import com.zmn.oms.model.entity.factory.OrderFactory;
import com.zmn.oms.model.entity.product.OrderProduct;
import com.zmn.oms.model.entity.work.OrderWork;
import com.zmn.oms.business.interfaces.work.orderpay.FactoryAccountModifyBService;
import com.zmn.oms.services.interfaces.factory.OrderFactoryService;
import com.zmn.oms.services.interfaces.work.OrderWorkService;
import com.zmn.pay.gateway.common.constants.OrderTypeConsts;
import com.zmn.pay.gateway.common.enums.AppEnum;
import com.zmn.pay.gateway.common.enums.OrderTypeEnum;
import com.zmn.pay.gateway.common.model.code.PayGatewayErrorCodeConsts;
import com.zmn.pay.gateway.common.model.dio.order.*;
import com.zmn.pay.gateway.common.model.dro.PayOrderDRO;
import com.zmn.pay.gateway.dubbo.interfaces.trade.ConsumeModifyRemoteService;
import com.zmn.pay.gateway.dubbo.interfaces.trade.FreezeModifyRemoteService;
import com.zmn.pay.gateway.dubbo.interfaces.trade.TransferModifyRemoteService;
import com.zmn.pay.gateway.dubbo.utils.DubboConsts;
import lombok.AllArgsConstructor;
import lombok.Data;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import java.util.Objects;
import java.util.Optional;

/**
 * @author sunlife
 * @date:2021/1/21 5:19 下午
 * description:
 */
@Service
public class FactoryAccountModifyBServiceImpl implements FactoryAccountModifyBService {

    private Logger logger = LoggerFactory.getLogger(FactoryAccountModifyBServiceImpl.class);

    @Autowired
    private OrderWorkService orderWorkService;
    @Autowired
    private OrderFactoryService orderFactoryService;

//    @Reference(version = com.zmn.base.plat.engine.common.constant.DubboConsts.INTERFACE_VERSION , check = false)
//    protected FactoryListRemoteService factoryListRemoteService;
    @Reference(version = com.zmn.account.dubbo.utils.AccountDubboConsts.INTERFACE_VERSION, check = false)
    protected AccountListRemoteService accountListRemoteService;
    @Reference(version = DubboConsts.INTERFACE_VERSION, check = false)
    protected ConsumeModifyRemoteService consumeModifyRemoteService;
    @Reference(version = DubboConsts.INTERFACE_VERSION, check = false)
    protected FreezeModifyRemoteService freezeModifyRemoteService;
    @Reference(version = DubboConsts.INTERFACE_VERSION, check = false)
    protected TransferModifyRemoteService transferModifyRemoteService;

    @Value("${spring.mq.topic.oms}")
    private String OMS_MQ_TOPIC;

    @Override
    public void freeze(OrderDTO orderDTO) throws OmsBaseException {
        if (Objects.equals(orderDTO.getOrderWork().getType(), OrderConsts.ORDER_TYPE_REWORK)) {
            return;
        }

        OrderWork orderWork = orderDTO.getOrderWork();
        OrderProduct product = orderDTO.getOrderProductList().get(0);
        OrderFactory orderFactory = orderDTO.getOrderFactory();

        if (Objects.equals(com.zmn.consts.GlobalConsts.BIZ_TYPE_F, orderWork.getBizType()) && orderFactory != null) {

            /*FactoryDRO factoryDRO = this.getFactoryInfo(orderFactory.getFactoryId());

            AccountInfoDRO accountInfoDRO = this.getFactoryAccountInfo(factoryDRO, orderDTO);

            // 保存冻结金额
            Integer shouldFreezeAmount = Optional.ofNullable(factoryDRO.getForzenAmount()).orElse(15000) * product.getNumber();

            if (Objects.equals(shouldFreezeAmount, 0)) {
                return;
            }

            FreezeDIO freezeOrderDIO = new FreezeDIO();

            Integer orderType = OrderTypeEnum.ORDER_TYPE_TRANSFER.getCode();
            Integer tradeCategId = OrderTypeConsts.AccountTradeCategEnum.CONSUME_FREEZE_OMS.getThirdId();
            freezeOrderDIO.setOrderType(orderType);
            freezeOrderDIO.setTradeCategId(tradeCategId);
            freezeOrderDIO.setAmount(shouldFreezeAmount);
            freezeOrderDIO.setAppId(AppEnum.APP_OMS.getAppId());
            freezeOrderDIO.setAppName(AppEnum.APP_OMS.getAppName());

            String bizNo = this.getPayUniqueId(orderWork.getPlatWork(), AppEnum.APP_OMS.getAppId(), tradeCategId);
            freezeOrderDIO.setAppBizNo(String.valueOf(orderWork.getOrderId()));
            freezeOrderDIO.setAppSubBizNo(bizNo);
            freezeOrderDIO.setPlat(orderDTO.getOrder().getPlat());
            freezeOrderDIO.setFromAccountId(accountInfoDRO.getAccountId());
            freezeOrderDIO.setToAccountId(this.getYEYXAccountInfo(orderDTO).getAccountId());
            freezeOrderDIO.setAccountId(accountInfoDRO.getAccountId());
            freezeOrderDIO.setOperator(orderDTO.getOperator());
            freezeOrderDIO.setOperatorId(orderDTO.getOperatorId());
            freezeOrderDIO.setOperatorType(orderDTO.getOperatorType());
            freezeOrderDIO.setSummary("添加订单冻结金额");

            logger.info("添加工单冻结金额入参： {}", JSON.toJSONString(freezeOrderDIO));
            ResponseDTO<PayOrderDRO>  accountOrderDROResponseDTO = freezeModifyRemoteService.freeze(freezeOrderDIO);
            logger.info("添加工单冻结金额出参： {}", JSON.toJSONString(accountOrderDROResponseDTO));

            if (!accountOrderDROResponseDTO.isSuccess()) {
                if (Objects.equals(accountOrderDROResponseDTO.getStatus(), PayGatewayErrorCodeConsts.BALANCE_AMOUNT_INSUFFICIENT)) {
                    exceptionDTO dto = exceptionMsgProcessor(accountOrderDROResponseDTO, factoryDRO);
                    throw new OmsBaseException(dto.getErrCode(), dto.getExpMsg());
                }
                throw new OmsBaseException(accountOrderDROResponseDTO.getStatus(), accountOrderDROResponseDTO.getMessage());
            }

            // 保存冻结流水号
            OrderFactory orderFactoryForUpdate = new OrderFactory();
            orderFactoryForUpdate.setFcOrderId(orderFactory.getFcOrderId());
            orderFactoryForUpdate.setAccountOrderId(accountOrderDROResponseDTO.getData().getOrderId());
            orderFactoryForUpdate.setFreezeAmount(shouldFreezeAmount);
            orderFactoryService.updateByKey(orderFactoryForUpdate);*/
        }
    }

    @Override
    public void unFreeze(OrderWork orderWork, OrderFactory orderFactory, OmsOperator operator) throws OmsBaseException {
        /*if (Objects.isNull(orderFactory)) {
            return;
        }

        if (Objects.isNull(orderFactory.getAccountOrderId()) || NumberUtil.isNullOrZero(orderFactory.getFreezeAmount())) {
            return;
        }

        if (NumberUtil.isNullOrZero(orderFactory.getFreezeAmount())) {
            return;
        }
        FactoryDRO factoryDRO = this.getFactoryInfo(orderFactory.getFactoryId());

        AccountInfoDRO accountInfoDRO = this.getFactoryAccountInfo(factoryDRO, operator);

        UnFreezeDIO cancelOrderDIO = new UnFreezeDIO();

        cancelOrderDIO.setSourceOrderId(orderFactory.getAccountOrderId());

        Integer tradeCategId = OrderTypeConsts.AccountTradeCategEnum.RECHARGE_UNFREEZE_OMS.getThirdId();
        cancelOrderDIO.setTradeCategId(tradeCategId);
        cancelOrderDIO.setAmount(orderFactory.getFreezeAmount());
        cancelOrderDIO.setAppId(AppEnum.APP_OMS.getAppId());
        cancelOrderDIO.setAppName(AppEnum.APP_OMS.getAppName());
        String bizNo = this.getPayUniqueId(orderWork.getPlatWork(), AppEnum.APP_OMS.getAppId(), tradeCategId);
        cancelOrderDIO.setAppBizNo(String.valueOf(orderWork.getOrderId()));
        cancelOrderDIO.setAppSubBizNo(bizNo);
        cancelOrderDIO.setPlat(orderWork.getPlatWork());
        cancelOrderDIO.setAccountId(accountInfoDRO.getAccountId());
        cancelOrderDIO.setOperator(operator.getOperator());
        cancelOrderDIO.setOperatorId(operator.getOperatorId());
        cancelOrderDIO.setOperatorType(operator.getOperatorType());
        cancelOrderDIO.setSummary("厂商单取消，取消冻结");
        logger.info("取消工单冻结金额入参： {}", JSON.toJSONString(cancelOrderDIO));
        ResponseDTO<PayOrderDRO> responseDTO = freezeModifyRemoteService.unfreeze(cancelOrderDIO);
        logger.info("取消工单冻结金额出参： {}", JSON.toJSONString(responseDTO));

        if (!responseDTO.isSuccess()) {
            if (Objects.equals(responseDTO.getStatus(), PayGatewayErrorCodeConsts.BALANCE_AMOUNT_INSUFFICIENT)) {
                exceptionDTO dto = exceptionMsgProcessor(responseDTO, factoryDRO);
                throw new OmsBaseException(dto.getErrCode(), dto.getExpMsg());
            }
            throw new OmsBaseException(responseDTO.getStatus(), responseDTO.getMessage());
        }*/

    }


    private String getPayUniqueId(Integer plat, String appName, Integer tradeCategId) {
        return String.format("%s%s%s%s", plat, appName, tradeCategId, DateUtil.getNowTimestamp());
    }

    @Override
    public PayOrderDRO consume(ZsOrderPayDTO payDTO) throws OmsBaseException {
        throw new OmsBaseException("厂商服务已下线");
        /*OrderFactory orderFactory = orderFactoryService.findOrderFactoryByKey(payDTO.getOrderId());
        if (Objects.isNull(orderFactory)) {
            return null;
        }

        OrderWork orderWork = orderWorkService.findOrderWorkByKeySrcMaster(payDTO.getOrderId(), payDTO.getWorkId());

        FactoryDRO factoryDRO = this.getFactoryInfo(orderFactory.getFactoryId());

        AccountInfoDRO accountInfoDRO = this.getFactoryAccountInfo(factoryDRO, payDTO);

        Integer consumeAmount = orderWork.getMasterAmount();

        ResponseDTO<PayOrderDRO> accountOrderDROResponseDTO = null;

        if (NumberUtil.isNullOrZero(orderFactory.getFreezeAmount())){
            ConsumeDIO consumeDIO = new ConsumeDIO();
            Integer tradeCategId = OrderTypeConsts.AccountTradeCategEnum.CONSUME_ORDER_PAY.getThirdId();
            consumeDIO.setTradeCategId(tradeCategId);
            consumeDIO.setAmount(consumeAmount);
            consumeDIO.setAppId(AppEnum.APP_OMS.getAppId());
            consumeDIO.setAppName(AppEnum.APP_OMS.getAppName());

            consumeDIO.setAppBizNo(String.valueOf(orderWork.getOrderId()));
            consumeDIO.setAppSubBizNo(this.getPayUniqueId(orderWork.getPlatWork(), AppEnum.APP_OMS.getAppId(), tradeCategId));
            consumeDIO.setPlat(orderWork.getPlatWork());
            consumeDIO.setAccountId(accountInfoDRO.getAccountId());
            consumeDIO.setOperator(payDTO.getOperator());
            consumeDIO.setOperatorId(payDTO.getOperatorId());
            consumeDIO.setOperatorType(payDTO.getOperatorType());
            consumeDIO.setSummary("工单解冻消费");
            logger.info("无冻结金额 工单消费 入参： {}", JSON.toJSONString(consumeDIO));
            accountOrderDROResponseDTO = consumeModifyRemoteService.consume(consumeDIO);

        } else {
            // 根据冻结金额与师傅收款额是否相等判断调用不同的接口
            ConsumeTransferDIO consumeTransferDIO = new ConsumeTransferDIO();
            consumeTransferDIO.setSourceOrderId(orderFactory.getAccountOrderId());
            consumeTransferDIO.setSourceAmount(orderFactory.getFreezeAmount());

            Integer tradeCategId = OrderTypeConsts.AccountTradeCategEnum.CONSUME_ORDER_PAY.getThirdId();
            consumeTransferDIO.setTradeCategId(tradeCategId);
            consumeTransferDIO.setAmount(consumeAmount);
            consumeTransferDIO.setAppId(AppEnum.APP_OMS.getAppId());
            consumeTransferDIO.setAppName(AppEnum.APP_OMS.getAppName());

            String appBizNo;
            if (!Objects.equals(consumeAmount, orderFactory.getFreezeAmount())) {
                appBizNo = String.format("%s%s", orderWork.getOrderId(), 2);
            } else {
                appBizNo = String.valueOf(orderWork.getOrderId());

            }
            consumeTransferDIO.setAppBizNo(appBizNo);
            consumeTransferDIO.setAppSubBizNo(this.getPayUniqueId(orderWork.getPlatWork(), AppEnum.APP_OMS.getAppId(), tradeCategId));
            consumeTransferDIO.setPlat(orderWork.getPlatWork());
            consumeTransferDIO.setAccountId(accountInfoDRO.getAccountId());
            consumeTransferDIO.setFromAccountId(accountInfoDRO.getAccountId());
            consumeTransferDIO.setToAccountId(this.getYEYXAccountInfo(payDTO).getAccountId());

            consumeTransferDIO.setOperator(payDTO.getOperator());
            consumeTransferDIO.setOperatorId(payDTO.getOperatorId());
            consumeTransferDIO.setOperatorType(payDTO.getOperatorType());
            consumeTransferDIO.setSummary("工单解冻消费");

            logger.info("有冻结金额 工单解冻消费 入参： {}", JSON.toJSONString(consumeTransferDIO));
            accountOrderDROResponseDTO = transferModifyRemoteService.unfreezeConsume(consumeTransferDIO);

        }
        logger.info("工单解冻消费 出参： {}", JSON.toJSONString(accountOrderDROResponseDTO));
        if (!accountOrderDROResponseDTO.isSuccess()) {
            if (Objects.equals(accountOrderDROResponseDTO.getStatus(), PayGatewayErrorCodeConsts.BALANCE_AMOUNT_INSUFFICIENT)) {
                exceptionDTO dto = exceptionMsgProcessor(accountOrderDROResponseDTO, factoryDRO);
                throw new OmsBaseException(dto.getErrCode(), dto.getExpMsg());
            }
            throw new OmsBaseException(accountOrderDROResponseDTO.getStatus(), accountOrderDROResponseDTO.getMessage());
        }

        OrderFactory updateOrderFactory = new OrderFactory();
        updateOrderFactory.setFcOrderId(orderFactory.getFcOrderId());
        updateOrderFactory.setAccountConsumeOrderId(accountOrderDROResponseDTO.getData().getOrderId());
        orderFactoryService.updateByKey(updateOrderFactory);
        return accountOrderDROResponseDTO.getData();*/
    }

    @Override
    public void refund(RefundInitiateBO refundInitiateBO) throws OmsBaseException {
        /*OrderFactory orderFactory = orderFactoryService.findOrderFactoryByKey(refundInitiateBO.getOriginalOrderId());

        if (null == orderFactory) {
            return;
        }

        if (NumberUtil.isNullOrZero(orderFactory.getAccountConsumeOrderId())) {
            throw new OmsBaseException("未获取资金账户消费ID，无法退款");
        }

        OrderWork refundOrderWork = refundInitiateBO.getRefundOrderWork();
        OmsOperator operator = refundInitiateBO.getOperator();

        FactoryDRO factoryDRO = this.getFactoryInfo(orderFactory.getFactoryId());

        AccountInfoDRO accountInfoDRO = this.getFactoryAccountInfo(factoryDRO, operator);

        ConsumeTransferDIO consumeTransferDIO = new ConsumeTransferDIO();

        Integer tradeCategId = OrderTypeConsts.AccountTradeCategEnum.TRANSFER_COMMON_REFUND.getThirdId();
        consumeTransferDIO.setTradeCategId(tradeCategId);
        consumeTransferDIO.setAmount(Math.abs(refundInitiateBO.getRefundAmount()));
        consumeTransferDIO.setAppId(AppEnum.APP_OMS.getAppId());
        consumeTransferDIO.setAppName(AppEnum.APP_OMS.getAppName());
        consumeTransferDIO.setAppBizNo(String.valueOf(refundOrderWork.getOrderId()));
        consumeTransferDIO.setAppSubBizNo(this.getPayUniqueId(refundOrderWork.getPlatWork(), AppEnum.APP_OMS.getAppId(), tradeCategId));
        consumeTransferDIO.setPlat(refundOrderWork.getPlatWork());

        Long yeyxAccountId = this.getYEYXAccountInfo(operator).getAccountId();
        consumeTransferDIO.setAccountId(yeyxAccountId);
        consumeTransferDIO.setFromAccountId(yeyxAccountId);
        consumeTransferDIO.setToAccountId(accountInfoDRO.getAccountId());


        consumeTransferDIO.setOperator(operator.getOperator());
        consumeTransferDIO.setOperatorId(operator.getOperatorId());
        consumeTransferDIO.setOperatorType(operator.getOperatorType());
        consumeTransferDIO.setSummary("工单退款");
        consumeTransferDIO.setSourceOrderId(orderFactory.getAccountConsumeOrderId());


        consumeTransferDIO.setNoticeMqTopic(OMS_MQ_TOPIC);
        consumeTransferDIO.setNoticeMqTag(RefundInitiateTypeEnum.getRefundNoticeMqTag(refundInitiateBO.getRefundInitiateType()));

        // 附加请求数据，供支付后续业务处理
        OmsRefundRequestDTO omsPayRequestDTO = new OmsRefundRequestDTO();
        omsPayRequestDTO.setOrderId(refundOrderWork.getOrderId());
        omsPayRequestDTO.setWorkId(refundOrderWork.getWorkId());
        omsPayRequestDTO.setRefundType(OrderConsts.ORDER_REFUND_TYPE_ONLINE);
        omsPayRequestDTO.setRefundInitiateType(refundInitiateBO.getRefundInitiateType());
        consumeTransferDIO.setNoticeMqExtendData(JSON.toJSONString(omsPayRequestDTO));

        logger.info("退款单退款 入参： {}", JSON.toJSONString(consumeTransferDIO));
        ResponseDTO<PayOrderDRO> responseDTO = transferModifyRemoteService.refund(consumeTransferDIO);
        logger.info("退款单退款 出参： {}", JSON.toJSONString(responseDTO));
        if (!responseDTO.isSuccess()) {
            if (Objects.equals(responseDTO.getStatus(), PayGatewayErrorCodeConsts.BALANCE_AMOUNT_INSUFFICIENT)) {
                exceptionDTO dto = exceptionMsgProcessor(responseDTO, factoryDRO);
                throw new OmsBaseException(dto.getErrCode(), dto.getExpMsg());
            }
            throw new OmsBaseException(responseDTO.getStatus(), responseDTO.getMessage());
        }*/
    }

    /*@Override
    public void verifyFactoryFreezePermit(FactoryDRO factoryDRO, Integer amount, OmsOperator operator) throws OmsBaseException {
        AccountInfoDRO accountInfoDRO = this.getFactoryAccountInfo(factoryDRO, operator);
        if (accountInfoDRO.getBalanceAmount() < amount) {
            if (factoryDRO.getSettlementType().equals(2)) {
                throw new OmsBaseException("厂商冻结余额不足，请提醒厂商充值后再下单");
            } else {
                throw new OmsBaseException("厂商余额不足，请提醒厂商充值后再下单");
            }
        }
    }*/

    /**
     * 获取厂商资金账户信息
     * @param factoryDRO
     * @return
     */
    /*private AccountInfoDRO getFactoryAccountInfo(FactoryDRO factoryDRO, OmsOperator operator) throws OmsBaseException {
        AccountInfoDIO accountInfoDIO = new AccountInfoDIO();
        accountInfoDIO.setIdentityId(IdentityConsts.ACCOUNT_IDENTITY_ID_FACTORY);
        accountInfoDIO.setIdentityObjectId(Long.valueOf(factoryDRO.getFactoryId()));
        if (Objects.equals(factoryDRO.getSettlementType(), 1)) {
            accountInfoDIO.setAccountCategId(AccountConsts.ACCOUNT_CATEG_TRADE_FUND);
        } else if (Objects.equals(factoryDRO.getSettlementType(), 2)) {
            accountInfoDIO.setAccountCategId(AccountConsts.ACCOUNT_CATEG_CREDIT);

        }
        accountInfoDIO.setOperator(operator.getOperator());
        accountInfoDIO.setOperatorId(operator.getOperatorId());
        accountInfoDIO.setOperatorType(operator.getOperatorType());
        ResponseDTO<AccountInfoDRO> accountInfoDROResponseDTO =  accountListRemoteService.getAccountInfo(accountInfoDIO);
        if (!accountInfoDROResponseDTO.isSuccess() || Objects.isNull(accountInfoDROResponseDTO.getData())) {
            logger.info("获取厂商资金账户失败 入参：{} 出参：{}", JSON.toJSONString(accountInfoDIO), JSON.toJSONString(accountInfoDROResponseDTO));
            throw new OmsBaseException("厂商资金账户获取失败");
        }
        return accountInfoDROResponseDTO.getData();
    }*/

    /**
     * 获取YEYX资金账户信息
     * @return
     */
    private AccountInfoDRO getYEYXAccountInfo(OmsOperator operator) throws OmsBaseException {
        AccountInfoDIO accountInfoDIO = new AccountInfoDIO();
        accountInfoDIO.setAccountCategId(AccountConsts.ACCOUNT_CATEG_TRADE_FUND);
        accountInfoDIO.setIdentityId(40);
        accountInfoDIO.setIdentityObjectId(Long.valueOf(20000));

        accountInfoDIO.setOperator(operator.getOperator());
        accountInfoDIO.setOperatorId(operator.getOperatorId());
        accountInfoDIO.setOperatorType(operator.getOperatorType());
        ResponseDTO<AccountInfoDRO> accountInfoDROResponseDTO =  accountListRemoteService.getAccountInfo(accountInfoDIO);
        if (!accountInfoDROResponseDTO.isSuccess() || Objects.isNull(accountInfoDROResponseDTO.getData())) {
            logger.info("获取YEYX资金账户失败 入参：{} 出参：{}", JSON.toJSONString(accountInfoDIO), JSON.toJSONString(accountInfoDROResponseDTO));
            throw new OmsBaseException("厂商资金账户获取失败");
        }
        return accountInfoDROResponseDTO.getData();
    }


    /**
     * 获取厂商资金账户信息
     * @param factoryId
     * @return
     */
    /*private FactoryDRO getFactoryInfo(Integer factoryId) throws OmsBaseException {
        throw new OmsBaseException("厂商服务已下线");
        logger.info("#冻结金额 查询厂商冻结金额配置 入参：{}", factoryId);
        ResponseDTO<FactoryDRO> responseDTO = factoryListRemoteService.getFactoryById(factoryId);
        logger.info("#冻结金额 查询厂商冻结金额配置 出参:{}", JSON.toJSONString(responseDTO));

        if (!responseDTO.isSuccess() || Objects.isNull(responseDTO.getData())) {
            throw new OmsBaseException("厂商冻结金额配置获取错误");
        }
        return responseDTO.getData();
    }*/

    /*private exceptionDTO exceptionMsgProcessor(ResponseDTO responseDTO, FactoryDRO factoryDRO) {
        String expMsg = responseDTO.getMessage();
        Integer errCode = responseDTO.getStatus();
        if (Objects.equals(errCode, PayGatewayErrorCodeConsts.BALANCE_AMOUNT_INSUFFICIENT) && Objects.equals(factoryDRO.getSettlementType(), 2)) {
            expMsg = "账户授信额度不足";
        }
        return new exceptionDTO(errCode, expMsg);
    }*/

    @Data
    @AllArgsConstructor
    private class exceptionDTO{
        private Integer errCode;

        private String expMsg;
    }

}
